<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
    

<head><meta name="generator" content="Hexo 3.8.0">
    <meta charset="utf-8">
    <meta name="keywords" content="飞行棋, Zhou•Yong">
    <meta name="description" content="控制板飞行棋博主闲的时候，写的一个小demo，控制板上玩飞行机，蛮简单，不复杂，分享给大家看，算是一个判断语句+循环语句的一个小应用

using System;
using System.Collections.Generic;
usin">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit|ie-stand|ie-comp">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <title>飞行棋 | Zhou•Yong</title>
    <link rel="icon" type="image/png" href="/favicon.png">

    <link rel="stylesheet" type="text/css" href="/libs/awesome/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/materialize/css/materialize.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/aos/aos.css">
    <link rel="stylesheet" type="text/css" href="/libs/animate/animate.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/lightGallery/css/lightgallery.min.css">
    <link rel="stylesheet" type="text/css" href="/css/matery.css">
    <link rel="stylesheet" type="text/css" href="/css/my.css">

    <script src="/libs/jquery/jquery-2.2.0.min.js"></script>
<link rel="stylesheet" href="/css/prism-tomorrow.css" type="text/css"></head>

</head>

<body>

<header class="navbar-fixed">
    <nav id="headNav" class="bg-color nav-transparent">
        <div id="navContainer" class="container">
            <div class="nav-wrapper">
                <div class="brand-logo">
                    <a href="/" class="waves-effect waves-light">
                        
                        <img src="/medias/logo.png" class="logo-img hide-on-small-only">
                        
                        <span class="logo-span">Zhou•Yong</span>
                    </a>
                </div>
                <a href="#" data-activates="mobile-nav" class="button-collapse"><i class="fa fa-navicon"></i></a>
<ul class="right">
    
    <li class="hide-on-med-and-down">
        <a href="/" class="waves-effect waves-light">
            
            <i class="fa fa-home"></i>
            
            <span>主页</span>
        </a>
    </li>
    
    <li class="hide-on-med-and-down">
        <a href="/about" class="waves-effect waves-light">
            
            <i class="fa fa-user-circle-o"></i>
            
            <span>个人介绍</span>
        </a>
    </li>
    
    <li class="hide-on-med-and-down">
        <a href="/categories" class="waves-effect waves-light">
            
            <i class="fa fa-bookmark"></i>
            
            <span>分类</span>
        </a>
    </li>
    
    <li class="hide-on-med-and-down">
        <a href="/tags" class="waves-effect waves-light">
            
            <i class="fa fa-tags"></i>
            
            <span>标签</span>
        </a>
    </li>
    
    <li class="hide-on-med-and-down">
        <a href="/friends" class="waves-effect waves-light">
            
            <i class="fa fa-address-book"></i>
            
            <span>推荐</span>
        </a>
    </li>
    
    <li>
        <a id="toggleSearch" class="waves-effect waves-light">
            <i id="searchIcon" class="mdi-action-search"></i>
        </a>
    </li>

</ul>

<div class="side-nav" id="mobile-nav">

    <div class="mobile-head bg-color">
        
        <img src="/medias/logo.png" class="logo-img circle responsive-img">
        
        <div class="logo-name">Zhou•Yong</div>
        <div class="logo-desc">
            
            你迈出的步伐不非得很大，只要你是在正确的方向前进就行
            
        </div>
    </div>

    <ul class="menu-list mobile-menu-list">
        
        <li>
            <a href="/" class="waves-effect waves-light">
                
                <i class="fa fa-fw fa-home"></i>
                
                主页
            </a>
        </li>
        
        <li>
            <a href="/about" class="waves-effect waves-light">
                
                <i class="fa fa-fw fa-user-circle-o"></i>
                
                个人介绍
            </a>
        </li>
        
        <li>
            <a href="/categories" class="waves-effect waves-light">
                
                <i class="fa fa-fw fa-bookmark"></i>
                
                分类
            </a>
        </li>
        
        <li>
            <a href="/tags" class="waves-effect waves-light">
                
                <i class="fa fa-fw fa-tags"></i>
                
                标签
            </a>
        </li>
        
        <li>
            <a href="/friends" class="waves-effect waves-light">
                
                <i class="fa fa-fw fa-address-book"></i>
                
                推荐
            </a>
        </li>
        
        
    </ul>

    <div class="social-link"><a href="#!" class="tooltipped" data-tooltip="邮件联系我: zy20081@126.com" data-position="top" data-delay="50">
    <i class="fa fa-envelope-open"></i>
</a>
<a href="#!" class="tooltipped" data-tooltip="QQ联系我: 314153271" data-position="top" data-delay="50">
    <i class="fa fa-qq"></i>
</a>

<a href="/atom.xml" class="tooltipped" target="_blank" data-tooltip="RSS 订阅" data-position="top" data-delay="50">
    <i class="fa fa-rss"></i>
</a>
</div>
</div>

            </div>
        </div>

        
    </nav>
</header>





<div class="bg-cover post-cover" style="background-image: url('/medias/featureimages/5.jpg')">
    <div class="container">
        <div class="row">
            <div class="col s12 m12 l12">
                <div class="brand">
                    <div class="description center-align post-title">
                        飞行棋
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>



<main class="post-container content">

    
    <link rel="stylesheet" href="/libs/tocbot/tocbot.css">
<style>
    #articleContent h1,
    #articleContent h2,
    #articleContent h3,
    #articleContent h4,
    #articleContent h5,
    #articleContent h6 {
        padding-top: 76px;
        margin-top: -76px;
    }

    #articleContent h1 {
        line-height: 3.5rem;
    }

    #articleContent h2 {
        line-height: 3.2rem;
    }

    #articleContent h3 {
        line-height: 2.8rem;
    }

    #articleContent h4 {
        line-height: 2.5rem;
    }

    #articleContent h5 {
        line-height: 2.2rem;
    }

    #articleContent h6 {
        line-height: 1.9rem;
    }

    #articleContent :focus {
        outline: none;
    }

    .toc-fixed {
        position: fixed;
        top: 64px;
    }

    .toc-widget {
        padding-left: 20px;
    }

    .toc-widget .toc-title {
        margin: 35px 0 15px 0;
        padding-left: 17px;
        font-size: 1.5rem;
        font-weight: bold;
        line-height: 1.5rem;
    }

    .toc-widget ol {
        padding: 0;
        list-style: none;
    }

    #toc-content ol {
        padding-left: 10px;
    }

    #toc-content ol li {
        padding-left: 10px;
    }

    #toc-content .toc-link:hover {
        color: #42b983;
        font-weight: 700;
        text-decoration: underline;
    }

    #toc-content .toc-link::before {
        background-color: transparent;
        max-height: 25px;
    }

    #toc-content .is-active-link {
        color: #42b983;
    }

    #toc-content .is-active-link::before {
        background-color: #42b983;
    }
</style>
<div class="row">
    <div class="col s12 m12 l9">
        <!-- 文章内容详情 -->
<div id="artDetail">
    <div class="card">
        <div class="card-content article-info">
            
            <div class="article-tag">
                
                <a href="/tags/C-基础知识/" target="_blank">
                    <span class="chip bg-color">C# 基础知识</span>
                </a>
                
                <a href="/tags/C/" target="_blank">
                    <span class="chip bg-color">C#</span>
                </a>
                
            </div>
            
            <div class="post-info">
                
                <span class="post-cate">
                    <i class="fa fa-bookmark fa-fw icon-category"></i>
                    
                    <a href="/categories/C/" class="post-category" target="_blank">
                        C#
                    </a>
                    
                </span>
                

                <span class="post-date">
                    <i class="fa fa-clock-o fa-fw"></i>2019-01-13
                </span>
            </div>
        </div>
        <hr>
        <div class="card-content article-card-content">
            <div id="articleContent">
                <h2 id="控制板飞行棋"><a href="#控制板飞行棋" class="headerlink" title="控制板飞行棋"></a>控制板飞行棋</h2><p>博主闲的时候，写的一个小demo，控制板上玩飞行机，蛮简单，不复杂，分享给大家看，算是一个判断语句+循环语句的一个小应用<br></p>
<p><img src="/2019/01/13/kong-zhi-ban-fei-xing-qi/1.jpg" alt="图1"></p>
<pre class=" language-bash"><code class="language-bash">using System<span class="token punctuation">;</span>
using System.Collections.Generic<span class="token punctuation">;</span>
using System.Linq<span class="token punctuation">;</span>
using System.Text<span class="token punctuation">;</span>

namespace 骑士飞行棋
<span class="token punctuation">{</span>
    class Program
    <span class="token punctuation">{</span>   //在下面的数组储存我们游戏地图的各各关卡
        //数组的下标为0的元素对应地图上的第1格，下标为1的元素对应第2格<span class="token punctuation">..</span>下标为n的元素对应n+1格
        //在数组中用1：表示幸运轮盘○2：地雷☆3：暂停▲4：时空隧道卍 0：表示普通
        static int<span class="token punctuation">[</span><span class="token punctuation">]</span> Map <span class="token operator">=</span> new int<span class="token punctuation">[</span>100<span class="token punctuation">]</span><span class="token punctuation">;</span>
        static int<span class="token punctuation">[</span><span class="token punctuation">]</span> playerPos <span class="token operator">=</span> <span class="token punctuation">{</span> 0, 0 <span class="token punctuation">}</span><span class="token punctuation">;</span>//playerPos<span class="token punctuation">[</span>0<span class="token punctuation">]</span>存玩家A的坐标，playerPos<span class="token punctuation">[</span>1<span class="token punctuation">]</span>存玩家B的坐标
        static int step<span class="token punctuation">;</span>//储存骰子数
        static string<span class="token punctuation">[</span><span class="token punctuation">]</span> names <span class="token operator">=</span> new string<span class="token punctuation">[</span>2<span class="token punctuation">]</span><span class="token punctuation">;</span>//names<span class="token punctuation">[</span>0<span class="token punctuation">]</span>为A，names<span class="token punctuation">[</span>1<span class="token punctuation">]</span>为B
        static string msg <span class="token operator">=</span> <span class="token string">""</span><span class="token punctuation">;</span>//记录信息,用户踩到某关卡输出的话
        static  bool<span class="token punctuation">[</span><span class="token punctuation">]</span> Istop <span class="token operator">=</span> <span class="token punctuation">{</span> false, <span class="token boolean">false</span> <span class="token punctuation">}</span><span class="token punctuation">;</span>//Istop<span class="token punctuation">[</span>0<span class="token punctuation">]</span>为A，Istop<span class="token punctuation">[</span>1<span class="token punctuation">]</span>为B
        static void Main<span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span>
        <span class="token punctuation">{</span>

            ShowUI<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            Console.WriteLine<span class="token punctuation">(</span><span class="token string">"请输入玩家A的姓名？"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            names<span class="token punctuation">[</span>0<span class="token punctuation">]</span> <span class="token operator">=</span> Console.ReadLine<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token keyword">while</span> <span class="token punctuation">(</span>names<span class="token punctuation">[</span>0<span class="token punctuation">]</span> <span class="token operator">==</span> <span class="token string">""</span><span class="token punctuation">)</span>
            <span class="token punctuation">{</span>
                Console.WriteLine<span class="token punctuation">(</span><span class="token string">"玩家A的姓名不能为空，请重新输入"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                names<span class="token punctuation">[</span>0<span class="token punctuation">]</span> <span class="token operator">=</span> Console.ReadLine<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
            Console.WriteLine<span class="token punctuation">(</span><span class="token string">"请输入玩家B的姓名？"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            names<span class="token punctuation">[</span>1<span class="token punctuation">]</span> <span class="token operator">=</span> Console.ReadLine<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token keyword">while</span> <span class="token punctuation">(</span>names<span class="token punctuation">[</span>1<span class="token punctuation">]</span> <span class="token operator">==</span> <span class="token string">""</span> <span class="token operator">||</span> names<span class="token punctuation">[</span>1<span class="token punctuation">]</span> <span class="token operator">==</span> names<span class="token punctuation">[</span>0<span class="token punctuation">]</span><span class="token punctuation">)</span>
            <span class="token punctuation">{</span>
                <span class="token keyword">if</span> <span class="token punctuation">(</span>names<span class="token punctuation">[</span>1<span class="token punctuation">]</span> <span class="token operator">==</span> <span class="token string">""</span><span class="token punctuation">)</span>
                <span class="token punctuation">{</span>
                    Console.WriteLine<span class="token punctuation">(</span><span class="token string">"玩家B的姓名不能为空，请重新输入"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                <span class="token punctuation">}</span>
                <span class="token keyword">if</span> <span class="token punctuation">(</span>names<span class="token punctuation">[</span>1<span class="token punctuation">]</span> <span class="token operator">==</span> names<span class="token punctuation">[</span>0<span class="token punctuation">]</span><span class="token punctuation">)</span>
                <span class="token punctuation">{</span>
                    Console.WriteLine<span class="token punctuation">(</span><span class="token string">"姓名以被玩家Ａ占用，重新输入"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                <span class="token punctuation">}</span>
                names<span class="token punctuation">[</span>1<span class="token punctuation">]</span> <span class="token operator">=</span> Console.ReadLine<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
            Console.Clear<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            ShowUI<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            Console.WriteLine<span class="token punctuation">(</span><span class="token string">"对战开始....."</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            Console.WriteLine<span class="token punctuation">(</span><span class="token string">"{0}用A来表示"</span>, names<span class="token punctuation">[</span>0<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            Console.WriteLine<span class="token punctuation">(</span><span class="token string">"{0}用B来表示"</span>, names<span class="token punctuation">[</span>1<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            Console.WriteLine<span class="token punctuation">(</span><span class="token string">"当AB在同一位置时，用&lt;>来表示"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            InitialMap<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            DrawMap<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            Console.ResetColor<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>//重置颜色默认；
            Console.WriteLine<span class="token punctuation">(</span><span class="token string">""</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            Console.WriteLine<span class="token punctuation">(</span><span class="token string">"游戏开始......"</span><span class="token punctuation">)</span><span class="token punctuation">;</span> 
                <span class="token keyword">while</span> <span class="token punctuation">(</span>playerPos<span class="token punctuation">[</span>0<span class="token punctuation">]</span> <span class="token operator">&lt;</span> 99 <span class="token operator">&amp;&amp;</span> playerPos<span class="token punctuation">[</span>1<span class="token punctuation">]</span> <span class="token operator">&lt;</span> 99<span class="token punctuation">)</span>
                <span class="token punctuation">{</span>
                    Console.WriteLine<span class="token punctuation">(</span><span class="token string">"******************************************"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                    Console.WriteLine<span class="token punctuation">(</span><span class="token string">"{0}的位置为{1}"</span>, names<span class="token punctuation">[</span>0<span class="token punctuation">]</span>, playerPos<span class="token punctuation">[</span>0<span class="token punctuation">]</span> + 1<span class="token punctuation">)</span><span class="token punctuation">;</span>
                    Console.WriteLine<span class="token punctuation">(</span><span class="token string">"{0}的位置为{1}"</span>, names<span class="token punctuation">[</span>1<span class="token punctuation">]</span>, playerPos<span class="token punctuation">[</span>1<span class="token punctuation">]</span> + 1<span class="token punctuation">)</span><span class="token punctuation">;</span>
                    if<span class="token punctuation">(</span>Istop<span class="token punctuation">[</span>0<span class="token punctuation">]</span><span class="token operator">==</span>false<span class="token punctuation">)</span>
                    <span class="token punctuation">{</span>
                    action<span class="token punctuation">(</span>0<span class="token punctuation">)</span><span class="token punctuation">;</span>//玩家A
                    <span class="token punctuation">}</span>
                <span class="token keyword">else</span> <span class="token punctuation">{</span> Istop<span class="token punctuation">[</span>0<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token boolean">false</span><span class="token punctuation">;</span> <span class="token punctuation">}</span>
                <span class="token keyword">if</span> <span class="token punctuation">(</span>playerPos<span class="token punctuation">[</span>0<span class="token punctuation">]</span><span class="token operator">>=</span>99<span class="token punctuation">)</span>
                <span class="token punctuation">{</span>
                    Console.Clear<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                    Console.ResetColor<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>//默认颜色
                    Console.WriteLine<span class="token punctuation">(</span><span class="token string">"**************"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                    Console.WriteLine<span class="token punctuation">(</span><span class="token string">"{0}赢了"</span>,names<span class="token punctuation">[</span>0<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                    <span class="token keyword">break</span><span class="token punctuation">;</span>
                <span class="token punctuation">}</span>
                <span class="token keyword">if</span> <span class="token punctuation">(</span>Istop<span class="token punctuation">[</span>1<span class="token punctuation">]</span> <span class="token operator">==</span> false<span class="token punctuation">)</span>
                <span class="token punctuation">{</span>
                    action<span class="token punctuation">(</span>1<span class="token punctuation">)</span><span class="token punctuation">;</span>//玩家B
                <span class="token punctuation">}</span>
                <span class="token keyword">else</span> <span class="token punctuation">{</span> Istop<span class="token punctuation">[</span>1<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token boolean">false</span><span class="token punctuation">;</span> <span class="token punctuation">}</span>
                <span class="token keyword">if</span> <span class="token punctuation">(</span>playerPos<span class="token punctuation">[</span>1<span class="token punctuation">]</span> <span class="token operator">>=</span> 99<span class="token punctuation">)</span>
                <span class="token punctuation">{</span>

                    Console.Clear<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                    Console.ResetColor<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>//默认颜色
                    Console.WriteLine<span class="token punctuation">(</span><span class="token string">"**************"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                    Console.WriteLine<span class="token punctuation">(</span><span class="token string">"{1}赢了"</span>, names<span class="token punctuation">[</span>1<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                    <span class="token keyword">break</span><span class="token punctuation">;</span>
                <span class="token punctuation">}</span>
                    Console.Clear<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                    DrawMap<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                    <span class="token keyword">if</span> <span class="token punctuation">(</span>msg <span class="token operator">!=</span> <span class="token string">""</span><span class="token punctuation">)</span>
                    <span class="token punctuation">{</span>
                        Console.WriteLine<span class="token punctuation">(</span><span class="token string">""</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                        Console.WriteLine<span class="token punctuation">(</span>msg<span class="token punctuation">)</span><span class="token punctuation">;</span>
                    <span class="token punctuation">}</span>
                    Console.WriteLine<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

                <span class="token punctuation">}</span>

            Console.WriteLine<span class="token punctuation">(</span><span class="token string">""</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

            Console.ReadKey<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
        /// <span class="token operator">&lt;</span>summary<span class="token operator">></span>
        /// A,B摇骰子
        /// <span class="token operator">&lt;</span>/summary<span class="token operator">></span>
        /// <span class="token operator">&lt;</span>param name<span class="token operator">=</span><span class="token string">"playerNumber"</span><span class="token operator">></span><span class="token operator">&lt;</span>/param<span class="token operator">></span>
         static void action<span class="token punctuation">(</span>int playerNumber<span class="token punctuation">)</span> 
        <span class="token punctuation">{</span>//1-playerNumber对方玩家,playerNumer当前
            Random r <span class="token operator">=</span> new Random<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>//随机数


            Console.WriteLine<span class="token punctuation">(</span><span class="token string">""</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            Console.WriteLine<span class="token punctuation">(</span><span class="token string">"{0}按任意键开始掷骰子"</span>, names<span class="token punctuation">[</span>playerNumber<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            ConsoleKeyInfo rec <span class="token operator">=</span> Console.ReadKey<span class="token punctuation">(</span>true<span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token keyword">if</span> <span class="token punctuation">(</span>rec.Key <span class="token operator">==</span> ConsoleKey.Tab <span class="token operator">&amp;&amp;</span> rec.Modifiers <span class="token operator">==</span> ConsoleModifiers.Alt<span class="token punctuation">)</span>
            <span class="token punctuation">{</span>

                step <span class="token operator">=</span> 99<span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
            <span class="token keyword">else</span>
            <span class="token punctuation">{</span>
                step <span class="token operator">=</span> r.Next<span class="token punctuation">(</span>1, 7<span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
            Console.WriteLine<span class="token punctuation">(</span><span class="token string">"{0}掷出了：{1}"</span>, names<span class="token punctuation">[</span>playerNumber<span class="token punctuation">]</span>, step<span class="token punctuation">)</span><span class="token punctuation">;</span>
            Console.ReadKey<span class="token punctuation">(</span>true<span class="token punctuation">)</span><span class="token punctuation">;</span>
            playerPos<span class="token punctuation">[</span>playerNumber<span class="token punctuation">]</span> <span class="token operator">=</span> playerPos<span class="token punctuation">[</span>playerNumber<span class="token punctuation">]</span> + step<span class="token punctuation">;</span>//一旦发生改变就要判断坐标是否大于99
            checkPos<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token keyword">if</span> <span class="token punctuation">(</span>playerPos<span class="token punctuation">[</span>0<span class="token punctuation">]</span> <span class="token operator">==</span> playerPos<span class="token punctuation">[</span>1<span class="token punctuation">]</span><span class="token punctuation">)</span>//玩家A踩到玩家B
            <span class="token punctuation">{</span>
                playerPos<span class="token punctuation">[</span>1-playerNumber<span class="token punctuation">]</span> <span class="token operator">=</span> 0<span class="token punctuation">;</span>
                msg <span class="token operator">=</span> string.Format<span class="token punctuation">(</span><span class="token string">"{0}踩到了{1},{1}退回原点"</span>, names<span class="token punctuation">[</span>playerNumber<span class="token punctuation">]</span>, names<span class="token punctuation">[</span>1-playerNumber<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
            <span class="token keyword">else</span>
            <span class="token punctuation">{</span>
                switch <span class="token punctuation">(</span>Map<span class="token punctuation">[</span>playerPos<span class="token punctuation">[</span>playerNumber<span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
                <span class="token punctuation">{</span>
                    <span class="token keyword">case</span> 0: <span class="token keyword">break</span><span class="token punctuation">;</span>//普通，没效果
                    <span class="token keyword">case</span> 1: Console.Clear<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                        DrawMap<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                        Console.WriteLine<span class="token punctuation">(</span><span class="token string">""</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                        Console.WriteLine<span class="token punctuation">(</span><span class="token string">"{0}走到了幸运轮盘，请选择运气？"</span>, names<span class="token punctuation">[</span>playerNumber<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                        Console.WriteLine<span class="token punctuation">(</span><span class="token string">"1--交换位置，2--轰炸对方"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                        int userSelect <span class="token operator">=</span> ReadInt<span class="token punctuation">(</span>1, 2<span class="token punctuation">)</span><span class="token punctuation">;</span>
                        <span class="token keyword">if</span> <span class="token punctuation">(</span>userSelect <span class="token operator">==</span> 1<span class="token punctuation">)</span>
                        <span class="token punctuation">{</span>
                            int temp <span class="token operator">=</span> playerPos<span class="token punctuation">[</span>playerNumber<span class="token punctuation">]</span><span class="token punctuation">;</span>
                            playerPos<span class="token punctuation">[</span>playerNumber<span class="token punctuation">]</span> <span class="token operator">=</span> playerPos<span class="token punctuation">[</span>1-playerNumber<span class="token punctuation">]</span><span class="token punctuation">;</span>
                            playerPos<span class="token punctuation">[</span>1-playerNumber<span class="token punctuation">]</span> <span class="token operator">=</span> temp<span class="token punctuation">;</span>
                            msg <span class="token operator">=</span> string.Format<span class="token punctuation">(</span><span class="token string">"{0}选择了与对方交换位置"</span>, names<span class="token punctuation">[</span>playerNumber<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                        <span class="token punctuation">}</span>//交换位置
                        <span class="token keyword">else</span> <span class="token keyword">if</span> <span class="token punctuation">(</span>userSelect <span class="token operator">==</span> 2<span class="token punctuation">)</span>
                        <span class="token punctuation">{</span>
                            playerPos<span class="token punctuation">[</span>1-playerNumber<span class="token punctuation">]</span> <span class="token operator">=</span> playerPos<span class="token punctuation">[</span>1-playerNumber<span class="token punctuation">]</span> - 6<span class="token punctuation">;</span>
                            checkPos<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                            msg <span class="token operator">=</span> string.Format<span class="token punctuation">(</span><span class="token string">"{0}轰炸了{1}，{1}退回6格"</span>, names<span class="token punctuation">[</span>playerNumber<span class="token punctuation">]</span>, names<span class="token punctuation">[</span>1-playerNumber<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>//轰炸对方
                        <span class="token punctuation">}</span>
                        <span class="token keyword">break</span><span class="token punctuation">;</span>
                    <span class="token keyword">case</span> 2:
                        playerPos<span class="token punctuation">[</span>playerNumber<span class="token punctuation">]</span> <span class="token operator">=</span> playerPos<span class="token punctuation">[</span>playerNumber<span class="token punctuation">]</span> - 6<span class="token punctuation">;</span>
                        checkPos<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                        msg <span class="token operator">=</span> string.Format<span class="token punctuation">(</span><span class="token string">"{0}踩到了地雷，退6格"</span>, names<span class="token punctuation">[</span>playerNumber<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                        <span class="token keyword">break</span><span class="token punctuation">;</span>//踩到地雷
                    <span class="token keyword">case</span> 3:
                        Istop<span class="token punctuation">[</span>playerNumber<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token boolean">true</span><span class="token punctuation">;</span>//暂停一次
                        msg <span class="token operator">=</span> string.Format<span class="token punctuation">(</span><span class="token string">"{0}暂停一次"</span>, names<span class="token punctuation">[</span>playerNumber<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                        <span class="token keyword">break</span><span class="token punctuation">;</span>//暂停一次
                    <span class="token keyword">case</span> 4: playerPos<span class="token punctuation">[</span>0<span class="token punctuation">]</span> <span class="token operator">=</span> playerPos<span class="token punctuation">[</span>0<span class="token punctuation">]</span> + 10<span class="token punctuation">;</span>
                        msg <span class="token operator">=</span> string.Format<span class="token punctuation">(</span><span class="token string">"{0}进入时空隧道，进10步"</span>, names<span class="token punctuation">[</span>playerNumber<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                        <span class="token keyword">break</span><span class="token punctuation">;</span>//时空隧道
                <span class="token punctuation">}</span>
            <span class="token punctuation">}</span>
            Console.Clear<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            DrawMap<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token keyword">if</span> <span class="token punctuation">(</span>msg <span class="token operator">!=</span> <span class="token string">""</span><span class="token punctuation">)</span>
            <span class="token punctuation">{</span>
                Console.WriteLine<span class="token punctuation">(</span><span class="token string">""</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                Console.WriteLine<span class="token punctuation">(</span>msg<span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span>

        <span class="token punctuation">}</span>
        /// <span class="token operator">&lt;</span>summary<span class="token operator">></span>
        /// 用来绘制飞行棋的名称
        /// <span class="token operator">&lt;</span>/summary<span class="token operator">></span>
        private static void ShowUI<span class="token punctuation">(</span><span class="token punctuation">)</span>
        <span class="token punctuation">{</span>
            Console.WriteLine<span class="token punctuation">(</span><span class="token string">"************************************************"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            Console.WriteLine<span class="token punctuation">(</span><span class="token string">"*                                              *"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            Console.WriteLine<span class="token punctuation">(</span><span class="token string">"*          骑  士  飞  行  棋                  *"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            Console.WriteLine<span class="token punctuation">(</span><span class="token string">"*                                              *"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            Console.WriteLine<span class="token punctuation">(</span><span class="token string">"************************************************"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

        <span class="token punctuation">}</span>
        /// <span class="token operator">&lt;</span>summary<span class="token operator">></span>
        /// 初始化
        /// <span class="token operator">&lt;</span>/summary<span class="token operator">></span>
        static void InitialMap<span class="token punctuation">(</span><span class="token punctuation">)</span>
        <span class="token punctuation">{</span>
            int<span class="token punctuation">[</span><span class="token punctuation">]</span> luckyTrun <span class="token operator">=</span> <span class="token punctuation">{</span> 6, 23, 40, 55, 69, 83, 98 <span class="token punctuation">}</span><span class="token punctuation">;</span>//幸运轮盘1
            int<span class="token punctuation">[</span><span class="token punctuation">]</span> landNine <span class="token operator">=</span> <span class="token punctuation">{</span> 5, 13, 17, 33, 38, 50, 64, 80, 94 <span class="token punctuation">}</span><span class="token punctuation">;</span>//地雷2
            int<span class="token punctuation">[</span><span class="token punctuation">]</span> pause <span class="token operator">=</span> <span class="token punctuation">{</span> 9, 27, 60, 93 <span class="token punctuation">}</span><span class="token punctuation">;</span>//暂停坐标3
            int<span class="token punctuation">[</span><span class="token punctuation">]</span> timeTunnel <span class="token operator">=</span> <span class="token punctuation">{</span> 20, 25, 45, 63, 72, 88, 90 <span class="token punctuation">}</span><span class="token punctuation">;</span>//时空隧道4
            <span class="token keyword">for</span> <span class="token punctuation">(</span>int i <span class="token operator">=</span> 0<span class="token punctuation">;</span> i <span class="token operator">&lt;</span> luckyTrun.Length<span class="token punctuation">;</span> i++<span class="token punctuation">)</span>
            <span class="token punctuation">{</span>
                Map<span class="token punctuation">[</span>luckyTrun<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">]</span> <span class="token operator">=</span> 1<span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
            <span class="token keyword">for</span> <span class="token punctuation">(</span>int i <span class="token operator">=</span> 0<span class="token punctuation">;</span> i <span class="token operator">&lt;</span> landNine.Length<span class="token punctuation">;</span> i++<span class="token punctuation">)</span>
            <span class="token punctuation">{</span>
                Map<span class="token punctuation">[</span>landNine<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">]</span> <span class="token operator">=</span> 2<span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
            <span class="token keyword">for</span> <span class="token punctuation">(</span>int i <span class="token operator">=</span> 0<span class="token punctuation">;</span> i <span class="token operator">&lt;</span> pause.Length<span class="token punctuation">;</span> i++<span class="token punctuation">)</span>
            <span class="token punctuation">{</span>
                Map<span class="token punctuation">[</span>pause<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">]</span> <span class="token operator">=</span> 3<span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
            <span class="token keyword">for</span> <span class="token punctuation">(</span>int i <span class="token operator">=</span> 0<span class="token punctuation">;</span> i <span class="token operator">&lt;</span> timeTunnel.Length<span class="token punctuation">;</span> i++<span class="token punctuation">)</span>
            <span class="token punctuation">{</span>
                Map<span class="token punctuation">[</span>timeTunnel<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">]</span> <span class="token operator">=</span> 4<span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
        <span class="token punctuation">}</span>
        /// <span class="token operator">&lt;</span>summary<span class="token operator">></span>
        /// 绘
        /// <span class="token operator">&lt;</span>/summary<span class="token operator">></span>
        /// <span class="token operator">&lt;</span>param name<span class="token operator">=</span><span class="token string">"pos"</span><span class="token operator">></span><span class="token operator">&lt;</span>/param<span class="token operator">></span>
        /// <span class="token operator">&lt;</span>returns<span class="token operator">></span><span class="token operator">&lt;</span>/returns<span class="token operator">></span>
        static string GetMapString<span class="token punctuation">(</span>int pos<span class="token punctuation">)</span>
        <span class="token punctuation">{</span>
            string result <span class="token operator">=</span> <span class="token string">""</span><span class="token punctuation">;</span>
            <span class="token keyword">if</span> <span class="token punctuation">(</span>playerPos<span class="token punctuation">[</span>0<span class="token punctuation">]</span> <span class="token operator">==</span> pos <span class="token operator">&amp;&amp;</span> playerPos<span class="token punctuation">[</span>1<span class="token punctuation">]</span> <span class="token operator">==</span> pos<span class="token punctuation">)</span>
            <span class="token punctuation">{</span>
                result <span class="token operator">=</span> <span class="token string">"&lt;>"</span><span class="token punctuation">;</span>
                Console.ForegroundColor <span class="token operator">=</span> ConsoleColor.Yellow<span class="token punctuation">;</span>

            <span class="token punctuation">}</span>
            <span class="token keyword">else</span> <span class="token keyword">if</span> <span class="token punctuation">(</span>playerPos<span class="token punctuation">[</span>0<span class="token punctuation">]</span> <span class="token operator">==</span> pos<span class="token punctuation">)</span>
            <span class="token punctuation">{</span>
                result <span class="token operator">=</span> <span class="token string">"Ａ"</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
            <span class="token keyword">else</span> <span class="token keyword">if</span> <span class="token punctuation">(</span>playerPos<span class="token punctuation">[</span>1<span class="token punctuation">]</span> <span class="token operator">==</span> pos<span class="token punctuation">)</span>
            <span class="token punctuation">{</span>
                result <span class="token operator">=</span> <span class="token string">"Ｂ"</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
            <span class="token keyword">else</span>
            <span class="token punctuation">{</span>
                switch <span class="token punctuation">(</span>Map<span class="token punctuation">[</span>pos<span class="token punctuation">]</span><span class="token punctuation">)</span> //1：表示幸运轮盘○2：地雷☆3：暂停▲4：时空隧道卍 0：表示普通
                <span class="token punctuation">{</span>
                    <span class="token keyword">case</span> 0: result <span class="token operator">=</span> <span class="token string">"□"</span><span class="token punctuation">;</span>
                        Console.ForegroundColor <span class="token operator">=</span> ConsoleColor.White<span class="token punctuation">;</span>
                        <span class="token keyword">break</span><span class="token punctuation">;</span>
                    <span class="token keyword">case</span> 1: result <span class="token operator">=</span> <span class="token string">"○"</span><span class="token punctuation">;</span>
                        Console.ForegroundColor <span class="token operator">=</span> ConsoleColor.DarkCyan<span class="token punctuation">;</span>
                        <span class="token keyword">break</span><span class="token punctuation">;</span>
                    <span class="token keyword">case</span> 2: result <span class="token operator">=</span> <span class="token string">"☆"</span><span class="token punctuation">;</span>
                        Console.ForegroundColor <span class="token operator">=</span> ConsoleColor.DarkMagenta<span class="token punctuation">;</span>
                        <span class="token keyword">break</span><span class="token punctuation">;</span>
                    <span class="token keyword">case</span> 3: result <span class="token operator">=</span> <span class="token string">"▲"</span><span class="token punctuation">;</span>
                        Console.ForegroundColor <span class="token operator">=</span> ConsoleColor.Cyan<span class="token punctuation">;</span>
                        <span class="token keyword">break</span><span class="token punctuation">;</span>
                    <span class="token keyword">case</span> 4: result <span class="token operator">=</span> <span class="token string">"卍"</span><span class="token punctuation">;</span>
                        Console.ForegroundColor <span class="token operator">=</span> ConsoleColor.DarkCyan<span class="token punctuation">;</span>
                        <span class="token keyword">break</span><span class="token punctuation">;</span>
                <span class="token punctuation">}</span>
            <span class="token punctuation">}</span>
            <span class="token keyword">return</span> result<span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
        /// <span class="token operator">&lt;</span>summary<span class="token operator">></span>
        /// 绘制地图
        /// <span class="token operator">&lt;</span>/summary<span class="token operator">></span>
        static void DrawMap<span class="token punctuation">(</span><span class="token punctuation">)</span>
        <span class="token punctuation">{</span>//画第一行，绘制0-29地图
            Console.WriteLine<span class="token punctuation">(</span><span class="token string">"○：表示幸运轮盘  ☆：地雷  ▲：暂停  卍：时空隧道"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token keyword">for</span> <span class="token punctuation">(</span>int i <span class="token operator">=</span> 0<span class="token punctuation">;</span> i <span class="token operator">&lt;=</span> 29<span class="token punctuation">;</span> i++<span class="token punctuation">)</span>
            <span class="token punctuation">{</span>
                Console.Write<span class="token punctuation">(</span>GetMapString<span class="token punctuation">(</span>i<span class="token punctuation">))</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
            Console.WriteLine<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            //画第一列，绘制30-34地图
            <span class="token keyword">for</span> <span class="token punctuation">(</span>int i <span class="token operator">=</span> 30<span class="token punctuation">;</span> i <span class="token operator">&lt;=</span> 34<span class="token punctuation">;</span> i++<span class="token punctuation">)</span>
            <span class="token punctuation">{</span>
                <span class="token keyword">for</span> <span class="token punctuation">(</span>int j <span class="token operator">=</span> 0<span class="token punctuation">;</span> j <span class="token operator">&lt;</span> 29<span class="token punctuation">;</span> j++<span class="token punctuation">)</span>
                <span class="token punctuation">{</span>
                    Console.Write<span class="token punctuation">(</span><span class="token string">"  "</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                <span class="token punctuation">}</span><span class="token punctuation">;</span>
                Console.WriteLine<span class="token punctuation">(</span>GetMapString<span class="token punctuation">(</span>i<span class="token punctuation">))</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
            //画35-64地图
            <span class="token keyword">for</span> <span class="token punctuation">(</span>int i <span class="token operator">=</span> 64<span class="token punctuation">;</span> i <span class="token operator">>=</span> 35<span class="token punctuation">;</span> i--<span class="token punctuation">)</span>
            <span class="token punctuation">{</span>
                Console.Write<span class="token punctuation">(</span>GetMapString<span class="token punctuation">(</span>i<span class="token punctuation">))</span><span class="token punctuation">;</span>

            <span class="token punctuation">}</span>
            Console.WriteLine<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            //画65-69地图
            <span class="token keyword">for</span> <span class="token punctuation">(</span>int i <span class="token operator">=</span> 65<span class="token punctuation">;</span> i <span class="token operator">&lt;=</span> 69<span class="token punctuation">;</span> i++<span class="token punctuation">)</span>
            <span class="token punctuation">{</span>
                Console.WriteLine<span class="token punctuation">(</span>GetMapString<span class="token punctuation">(</span>i<span class="token punctuation">))</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
            //画70-99地图
            <span class="token keyword">for</span> <span class="token punctuation">(</span>int i <span class="token operator">=</span> 70<span class="token punctuation">;</span> i <span class="token operator">&lt;=</span> 99<span class="token punctuation">;</span> i++<span class="token punctuation">)</span>
            <span class="token punctuation">{</span>
                Console.Write<span class="token punctuation">(</span>GetMapString<span class="token punctuation">(</span>i<span class="token punctuation">))</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
        <span class="token punctuation">}</span>
        //static int ReadInt<span class="token punctuation">(</span><span class="token punctuation">)</span>
        //<span class="token punctuation">{</span>
        //    int i <span class="token operator">=</span> ReadInt<span class="token punctuation">(</span>int.MinValue, int.MaxValue<span class="token punctuation">)</span><span class="token punctuation">;</span>
        //    <span class="token keyword">return</span> i<span class="token punctuation">;</span>
        //<span class="token punctuation">}</span>
        static int ReadInt<span class="token punctuation">(</span>int min, int max<span class="token punctuation">)</span>
        <span class="token punctuation">{</span>
            int number <span class="token operator">=</span> 0<span class="token punctuation">;</span>
            <span class="token keyword">for</span> <span class="token punctuation">(</span>int j <span class="token operator">=</span> 100<span class="token punctuation">;</span> j <span class="token operator">></span> 0<span class="token punctuation">;</span> j--<span class="token punctuation">)</span>
            <span class="token punctuation">{</span>
                try
                <span class="token punctuation">{</span>
                    number <span class="token operator">=</span> Convert.ToInt32<span class="token punctuation">(</span>Console.ReadLine<span class="token punctuation">(</span><span class="token punctuation">))</span><span class="token punctuation">;</span>
                <span class="token punctuation">}</span>
                catch <span class="token punctuation">(</span>Exception<span class="token punctuation">)</span>
                <span class="token punctuation">{</span>

                    Console.WriteLine<span class="token punctuation">(</span><span class="token string">"只能输入数字"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                <span class="token punctuation">}</span>
                <span class="token keyword">if</span> <span class="token punctuation">(</span>number <span class="token operator">&lt;</span> min <span class="token operator">||</span> number <span class="token operator">></span> max<span class="token punctuation">)</span>
                <span class="token punctuation">{</span>
                    Console.WriteLine<span class="token punctuation">(</span><span class="token string">"只能输入{0}-{1}之间的数字"</span>, min, max<span class="token punctuation">)</span><span class="token punctuation">;</span>
                <span class="token punctuation">}</span>
                <span class="token keyword">else</span> <span class="token punctuation">{</span> <span class="token keyword">break</span><span class="token punctuation">;</span> <span class="token punctuation">}</span>
            <span class="token punctuation">}</span>
            <span class="token keyword">return</span> number<span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
        /// <span class="token operator">&lt;</span>summary<span class="token operator">></span>
        /// 检查
        /// <span class="token operator">&lt;</span>/summary<span class="token operator">></span>
        private static void checkPos<span class="token punctuation">(</span><span class="token punctuation">)</span>
        <span class="token punctuation">{</span>
            <span class="token keyword">if</span> <span class="token punctuation">(</span>playerPos<span class="token punctuation">[</span>0<span class="token punctuation">]</span> <span class="token operator">></span> 99 <span class="token operator">||</span> playerPos<span class="token punctuation">[</span>1<span class="token punctuation">]</span> <span class="token operator">></span> 99<span class="token punctuation">)</span>
            <span class="token punctuation">{</span>
                playerPos<span class="token punctuation">[</span>0<span class="token punctuation">]</span> <span class="token operator">=</span> 99<span class="token punctuation">;</span>
                Console.WriteLine<span class="token punctuation">(</span><span class="token string">"你赢了"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
            <span class="token keyword">else</span> <span class="token keyword">if</span> <span class="token punctuation">(</span>playerPos<span class="token punctuation">[</span>0<span class="token punctuation">]</span> <span class="token operator">&lt;</span> 0 <span class="token operator">||</span> playerPos<span class="token punctuation">[</span>1<span class="token punctuation">]</span> <span class="token operator">&lt;</span> 0<span class="token punctuation">)</span>
            <span class="token punctuation">{</span>
                playerPos<span class="token punctuation">[</span>0<span class="token punctuation">]</span> <span class="token operator">=</span> 0<span class="token punctuation">;</span>
            <span class="token punctuation">}</span>

        <span class="token punctuation">}</span>
        //private static string<span class="token punctuation">[</span><span class="token punctuation">]</span> tong<span class="token punctuation">(</span>string<span class="token punctuation">[</span><span class="token punctuation">]</span> a,string<span class="token punctuation">[</span><span class="token punctuation">]</span> b<span class="token punctuation">)</span>
        //<span class="token punctuation">{</span>


        //<span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>

</code></pre>

            </div>
            <hr>

            
            <style>
    #reward {
        margin: 40px 0;
        text-align: center;
    }

    #reward .reward-link {
        font-size: 1.88rem;
    }

    #reward .btn-floating:hover {
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2), 0 5px 15px rgba(0, 0, 0, 0.2);
    }

    #rewardModal {
        width: 320px;
        height: 350px;
    }

    #rewardModal .reward-title {
        margin: 15px auto;
        padding-bottom: 5px;
    }

    #rewardModal .modal-content {
        padding: 10px;
    }

    #rewardModal .close {
        position: absolute;
        right: 15px;
        top: 15px;
        color: rgba(0, 0, 0, 0.5);
        font-size: 1.3rem;
        line-height: 20px;
        cursor: pointer;
    }

    #rewardModal .reward-tabs {
        margin: 0 auto;
        width: 210px;
    }

    .reward-tabs .tabs {
        height: 38px;
        margin: 10px auto;
        padding-left: 0;
    }

    .reward-tabs .tabs .tab {
        height: 38px;
        line-height: 38px;
    }

    .reward-tabs .tab a {
        color: #fff;
        background-color: #ccc;
    }

    .reward-tabs .tab a:hover {
        color: #fff;
    }

    .reward-tabs .wechat-tab .active {
        color: #fff;
        background-color: #22AB38;
    }

    .reward-tabs .alipay-tab .active {
        color: #fff;
        background-color: #019FE8;
    }

    .reward-tabs .reward-img {
        width: 210px;
        height: 210px;
    }
</style>

<div id="reward">
    <a class="reward-link btn-floating btn-large waves-effect waves-light red">赏</a>

    <!-- Modal Structure -->
    <div id="rewardModal" class="modal">
        <div class="modal-content">
            <a class="close"><i class="fa fa-close"></i></a>
            <h4 class="reward-title">你的赏识是我前进的动力</h4>
            <div class="reward-content">
                <div class="reward-tabs">
                    <ul class="tabs">
                        <li class="tab wechat-tab waves-effect waves-light"><a class="active" href="#wechat">微信</a></li>
                        <li class="tab alipay-tab waves-effect waves-light"><a href="#alipay">支付宝</a></li>
                    </ul>
                    <div id="wechat">
                        <img src="/medias/reward/wechat.png" class="reward-img" alt="微信打赏二维码">
                    </div>
                    <div id="alipay">
                        <img src="/medias/reward/alipay.jpg" class="reward-img" alt="支付宝打赏二维码">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    $(function () {
        $('#reward .reward-link').on('click', function () {
            $('#rewardModal').openModal();
        });

        $('#rewardModal .close').on('click', function () {
            $('#rewardModal').closeModal();
        });
    });
</script>
            

            <link rel="stylesheet" type="text/css" href="/libs/share/css/share.min.css">

<div id="article-share">
    
    <div class="social-share" data-disabled="qzone" data-wechat-qrcode-helper="<p>微信里点“发现”->“扫一扫”二维码便可查看分享。</p>"></div>
    
</div>

<script src="/libs/share/js/social-share.min.js"></script>

            <div class="reprint">
                <p>
                    <span class="reprint-tip">转载请注明: </span>
                    <a href="https://zy20081.github.io" class="b-link-green">Zhou•Yong</a>
                    <i class="fa fa-angle-right fa-lg fa-fw text-color"></i>
                    <a href="/2019/01/13/kong-zhi-ban-fei-xing-qi/" class="b-link-green">飞行棋</a>
                </p>
            </div>
        </div>
    </div>

    

    

    

    

    

    

<article id="prenext-posts" class="prev-next articles">
    <div class="row article-row">
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge left-badge text-color">上一篇</div>
            <div class="card">
                <a href="/2019/01/13/c-zhi-ref/">
                    <div class="card-image">
                        
                        
                        <img src="/medias/featureimages/8.jpg" class="responsive-img" alt="C#之ref">
                        
                        <span class="card-title">C#之ref</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary">C#之ref
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace @ref
{
    class</div>
                    <div class="publish-info">
                        <span class="publish-date">
                            <i class="fa fa-clock-o fa-fw icon-date"></i>2019-01-13
                        </span>
                        <span class="publish-author">
                            
                            <i class="fa fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/categories/C/" class="post-category" target="_blank">
                                    C#
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/tags/C-基础知识/" target="_blank">
                        <span class="chip bg-color">C# 基础知识</span>
                    </a>
                    
                    <a href="/tags/C/" target="_blank">
                        <span class="chip bg-color">C#</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge right-badge text-color">下一篇</div>
            <div class="card">
                <a href="/2019/01/13/asp.net-web-zi-dai-an-quan-ji-zhi/">
                    <div class="card-image">
                        
                        
                        <img src="/medias/featureimages/8.jpg" class="responsive-img" alt="ASP.net web自带安全机制">
                        
                        <span class="card-title">ASP.net web自带安全机制</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary">ASP.net web自带安全机制Web.config配置&lt;configuration>
  &lt;location path="defalut.aspx">
    &lt;system.web>
      &lt;author</div>
                    <div class="publish-info">
                            <span class="publish-date">
                                <i class="fa fa-clock-o fa-fw icon-date"></i>2019-01-13
                            </span>
                        <span class="publish-author">
                            
                            <i class="fa fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/categories/ASP-NET/" class="post-category" target="_blank">
                                    ASP.NET
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/tags/C-基础知识/" target="_blank">
                        <span class="chip bg-color">C# 基础知识</span>
                    </a>
                    
                    <a href="/tags/C/" target="_blank">
                        <span class="chip bg-color">C#</span>
                    </a>
                    
                    <a href="/tags/ASP-NET/" target="_blank">
                        <span class="chip bg-color">ASP.NET</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
    </div>
</article>
</div>


    </div>
    <div class="col l3 hide-on-med-and-down">
        <div class="toc-widget">
            <div class="toc-title">目录</div>
            <div id="toc-content">

            </div>
        </div>
    </div>
</div>

<script src="/libs/tocbot/tocbot.min.js"></script>
<script>
    $(function () {
        tocbot.init({
            tocSelector: '#toc-content',
            contentSelector: '#articleContent',
            headingSelector: 'h2, h3, h4'
        });

        // modify the toc link href to support Chinese.
        let i = 0;
        let tocHeading = 'toc-heading-';
        $('#toc-content a').each(function () {
            $(this).attr('href', '#' + tocHeading + (++i));
        });

        // modify the heading title id to support Chinese.
        i = 0;
        $('#articleContent').children('h2, h3, h4').each(function () {
            $(this).attr('id', tocHeading + (++i));
        });

        // Set scroll toc fixed.
        let tocHeight = parseInt($(window).height() * 0.4 - 64);
        let $tocWidget = $('.toc-widget');
        $(window).scroll(function () {
            let scroll = $(window).scrollTop();
            /* add post toc fixed. */
            if (scroll > tocHeight) {
                $tocWidget.addClass('toc-fixed');
            } else {
                $tocWidget.removeClass('toc-fixed');
            }
        });
    });
</script>
    

</main>


<footer class="page-footer bg-color">
    <div class="container row center-align">
        <div class="col s12 m8 l8 copy-right">
            本站由ZhouYong 技术分享，心得分享.
        </div>
        <div class="col s12 m4 l4 social-link"><a href="#!" class="tooltipped" data-tooltip="邮件联系我: zy20081@126.com" data-position="top" data-delay="50">
    <i class="fa fa-envelope-open"></i>
</a>
<a href="#!" class="tooltipped" data-tooltip="QQ联系我: 314153271" data-position="top" data-delay="50">
    <i class="fa fa-qq"></i>
</a>

<a href="/atom.xml" class="tooltipped" target="_blank" data-tooltip="RSS 订阅" data-position="top" data-delay="50">
    <i class="fa fa-rss"></i>
</a>
</div>
    </div>
</footer>

<div class="progress-bar"></div>


<!-- 搜索遮罩框 -->
<div id="searchModal" class="modal">
    <div class="modal-content">
        <div class="search-header">
            <span class="title">搜索</span>
            <input type="search" id="searchInput" name="s" placeholder="请输入搜索的关键字" class="search-input" autofocus>
        </div>
        <div id="searchResult"></div>
    </div>
</div>

<script src="/js/search.js"></script>
<script type="text/javascript">
    searchFunc("/" + "search.xml", 'searchInput', 'searchResult');
</script>
<!-- 回到顶部按钮 -->
<div id="backTop" class="top-scroll">
    <a class="btn-floating btn-large waves-effect waves-light" href="#!">
        <i class="fa fa-angle-up"></i>
    </a>
</div>


<script src="/libs/materialize/js/materialize.min.js"></script>
<script src="/libs/masonry/masonry.pkgd.min.js"></script>
<script src="/libs/aos/aos.js"></script>
<script src="/libs/scrollprogress/scrollProgress.min.js"></script>
<script src="/libs/lightGallery/js/lightgallery-all.min.js"></script>

<script src="/libs/others/clicklove.js"></script>

<script src="/js/matery.js"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->


</body>
</html>